# Contributor: Robert Sacks <robert@sacks.email>
# Maintainer: Robert Sacks <robert@sacks.email>
pkgname=py3-subunit
pkgver=1.4.4
pkgrel=0
pkgdesc="Python implementation of subunit test streaming protocol"
url="https://launchpad.net/subunit"
arch="noarch"
license="Apache-2.0 OR BSD-3-Clause"
depends="python3 py3-extras py3-iso8601 py3-testtools"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/python-subunit/python-subunit-$pkgver.tar.gz"
builddir="$srcdir/python-subunit-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

# tests require testscenarios; use smoke test for now
check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -c "import subunit"
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
	rm -rf "$pkgdir"/usr/lib/python3.*/site-packages/subunit/tests
}

sha512sums="
67f8dd012d33ae719a4b4ff45981fcc98ce268f2aa3f1c6db80af271439cfd9811bb0d27b08b20a7317d24decb416b3ac34ea8bc8baf7bd82fea7d6a64ff6979  python-subunit-1.4.4.tar.gz
"
